home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / opengl / x+opengl / README < prev    next >
Encoding:
Text File  |  1994-08-02  |  6.9 KB  |  143 lines

  1.  
  2.           ~4Dgifts/toolbox/src/exampleCode/opengl/x+opengl README 
  3.  
  4.     `!' indicates new or updated as of version 4.2
  5.  
  6.  
  7.        This directory contains source code from a three-part series of 
  8.        articles published in "The X Journal" about programming OpenGL and 
  9.        X, plus the renderboth.c program, based on glxmotif.c  Included in 
  10.        each article is a complete program that is also reproduced here in 
  11.        compilable form.
  12.        
  13.  
  14.  
  15.       intro.ps:  "OpenGL(tm) and X, Part 1:  An Introduction", Mark Kilgard,
  16.                  "The X Journal", November/December, 1993.
  17.  
  18.       The OpenGL graphics system is a high-performance, window system
  19.       independent 2D and 3D graphics interface.  The technology was developed
  20.       by Silicon Graphics and is now controlled by the OpenGL Architecture
  21.       Review Board.  OpenGL's GLX extension integrates OpenGL with the X
  22.       Window System.  This article describes OpenGL's functionality and how
  23.       it is used with X.  A simple OpenGL program using Xlib is presented.
  24.       OpenGL is compared and contrasted with PEX, a 3D graphics interface
  25.       designed specifically for X.  The two subsequent articles in this
  26.       series describe how to integrate OpenGL with Xlib and Motif programs.
  27.  
  28.         glxsimple.c  A very simple OpenGL program rendering a cube which 
  29.              can be rotated using buttons presses.  The program 
  30.                      demonstrates creating a window for use with OpenGL, 
  31.                      hidden surface removal, and double buffering.  This 
  32.              program is presented in the first article in the 
  33.              November/December issue.
  34.  
  35.  
  36.        
  37.       xlib.ps:  "OpenGL(tm) and X, Part 2:  Using OpenGL with Xlib", Mark
  38.                  Kilgard, "The X Journal", January/February, 1994.
  39.  
  40.       This is the second article in a three-part series about using the
  41.       OpenGL(tm) graphics system and the X Window System.  A moderately
  42.       complex OpenGL program for X is presented.  Depth Buffering, back-face
  43.       culling, lighting, display list modeling, polygon tessellation, double
  44.       buffering, and shading are all demonstrated.  The program adheres to
  45.       proper X conventions for colormap sharing, window manager communication,
  46.       command line argument processing, and event processing.  After the
  47.       example, advanced X and OpenGL issues are discussed including minimizing
  48.       colormap flashing, handling overlays, using fonts, and performing
  49.       animation.  The last article in this series discussess integrating
  50.       OpenGL with the Motif toolkit.
  51.  
  52.         glxdino.c    A moderately complex OpenGL program that renders a 3D
  53.              dinosaur which can be rotated with mouse input.  The 
  54.              program demonstrates colormap sharing, proper set up 
  55.              of X window manager properties, maintaining window 
  56.              aspect ratios, back-face culling, double buffering, 
  57.              display list modeling, polygon tesselation, hidden 
  58.              surface removal, shading, lighting, and X event 
  59.              processing.  This program is presented in the second 
  60.              article in the January/February issue.
  61.        
  62.  
  63.  
  64.         motif.PS:  "OpenGL(tm) and X, Part 3: Integrating OpenGL with Motif",
  65.                     Mark Kilgard, "The X Journal", July/August, 1994.
  66.  
  67.         The OpenGL(tm) graphics system can be integrated with the
  68.         industry-standard OSF/Motif user interface.  This article
  69.         discusses how to use OpenGL within a Motif application
  70.         program.  There are two approaches to using OpenGL with Motif.
  71.         One is to render into a standard Motif drawing area widget, but
  72.         this requires each application window to use a single visual
  73.         for its window hierarchy.  A better approach is to use the
  74.         special OpenGL drawing area widget allowing windows used for
  75.         OpenGL rendering to pick freely an appropriate visual without
  76.         affecting the visual choice for other widgets.  An example
  77.         program demonstrates both approaches.  The X Toolkit's work
  78.         procedure mechanism animates the example's 3D paper airplanes.
  79.         Handling OpenGL errors is also explained.
  80.  
  81.         paperplane.c  A toy Motif program which draws 3D paperplanes
  82.                      flying in figure-eights on a sky background.  The 
  83.              program demonstrates both how to use the OpenGL-
  84.              specific Motif widget and how to use the standard 
  85.              Motif drawing area widget.  Motif pull down menus to
  86.              implement the GUI controls for the program.  Work 
  87.              procs handle the animal.  This program is presented in 
  88.              the third article in the July/August issue.
  89.  
  90.  
  91.         glxmotif.c   A program demonstrating how to use OpenGL with Motif 
  92.              (not using a special OpenGL widget).  Work procs are 
  93.              used for animation.  Press "s" to stop and start 
  94.              spinning the polygons; the arrow keys rotate the scene 
  95.              manually.  This program is presented in the third 
  96.              article in the March/April issue.  This program does 
  97.                      not appear in any of the three articles, but appeared
  98.                      on the last Toolbox and appears here for completeness.
  99.  
  100.  
  101.  !      renderboth.c   This is an example of rendering with X and Open GL 
  102.              to the same window.  Based on Mark Kilgard's glxmotif
  103.              example, I also use a standard motif XmDrawingArea 
  104.              widget as the rendering medium.
  105.  
  106.                      The example first draws the series of polygons that 
  107.              Mark's glxmotif used.  Then I call XDrawLines to 
  108.              render a star composed of lines over the top of the 
  109.              Open GL-rendered polys.
  110.  
  111.                      We will try to do double-buffered rendering if 
  112.              possible.  This will happen if there is a double-
  113.              buffered visual meeting the base depth criteria, that 
  114.              also has double-buffered X rendering capability. This
  115.              is governed by the presence of the Xnmbx extension.  
  116.              If the Xnmbx extension is not available, or if the 
  117.              visual we turned up using glXChooseVisual on the base 
  118.              criteria does not have Xnmbx capability, we will fall 
  119.              back into single-buffering.
  120.  
  121.                      The X multi-buffering extension is necessary to gain 
  122.              the proper synchronization between multibuffered 
  123.              rendering in X and Open GL.  The XSync() call after 
  124.              both buffer swap calls (glXSwapBuffers and 
  125.              sgiXnmbxSwapWindow() is necessary to maintain 
  126.              synchronized buffer pointers as well.
  127.  
  128.                      Without the buffer management layer provided by the 
  129.              Xnmbx extension, X will render to a static address in
  130.              the drawable ... so your X rendering results will show 
  131.              up only every other time (since it seems to always 
  132.              render to what is the initial front buffer.
  133.  
  134.                      Known problems :
  135.  
  136.                      Trying to render in X to the active buffer does not work.
  137.  
  138.                      pcd@sgi.com 7/94
  139.  
  140.        
  141.        These programs will operate on an IRIS 4D machine running IRIX 5.1 
  142.        or later.
  143.